export const today = new Date().getFullYear() + '-' +
    (new Date().getMonth() + 1 < 10 ? ('0' + (new Date().getMonth() + 1)) : (new Date().getMonth() + 1)) + '-' +
    (new Date().getDate() + 1 < 10 ? ('0' + new Date().getDate()) : (new Date().getDate()))
export const year = new Date().getFullYear()
export const getWeek = function getTime(n) {
    let now = new Date();
    let day = now.getDay(); //返回星期几的某一天;
    n = day == 0 ? n + 6 : n + (day - 1)
    now.setDate(now.getDate() - n);
    let year = now.getFullYear();
    let month = now.getMonth() + 1;
    let date = now.getDate();
    let s = year + "-" + (month < 10 ? ('0' + month) : month) + "-" + (date < 10 ? ('0' + date) : date);
    return s;
}
